﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Demo
{
    public partial class MDIForm : Form
    {
        public MDIForm()
        {
            InitializeComponent();
        }

        private void MDIForm_Load(object sender, EventArgs e)
        {
            //this.IsMdiContainer = true;
        }

        private void newFormButton_Click(object sender, EventArgs e)
        {
            Form childForm = new DemoListView();

            childForm.MdiParent = this;
            childForm.Show();
        }

        private void layoutButton_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(MdiLayout.Cascade);
        }

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Clicked " + ((ToolStripMenuItem)sender).Text);
        }

        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Clicked on ToolBar " + ((ToolStripButton)sender).Text);
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
            timer1.Start();
            toolStripProgressBar1.Visible = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripProgressBar1.PerformStep();

            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                toolStripProgressBar1.Visible = false;
                timer1.Stop();
            }
        }
    }
}
